The present invention relates generally to the installation of software applications on a computer system, and more particularly to patching a software application on a computer system.
Software application installation is an area of increasing importance. Unfortunately, existing installation technologies fail to address all of a computer user""s needs. Most installation technologies are simply brute-force mechanisms for copying program files from one location to another. Only one known installer program even comes close.
The one installer program that comes close to addressing all of a computer user""s needs manages the installation of an application so that information related to of each of the application""s resources is stored in a xe2x80x9cconfiguration database.xe2x80x9d The configuration database may be registry keys within the system registry, or it may be a stand-alone database. The stored information includes, but is not limited to, the installed state of the application (i.e., what features of the application are or are not installed, whether the application should be run locally or run from a source, paths to the program files of the application, whether features are xe2x80x9cadvertisedxe2x80x9d but not installed, etc.). That information is stored at install time and is used by the installer program to ensure that an application always has available the resources that it expects or that the user requests. For instance, one function of the installer program is to verify the existence of a resource needed by the application. When the application requests a path to a program file, the installer program verifies the existence of that program file at the expected location stored in the configuration database. If, for some unexpected reason, the program file does not exist at the expected location, the installer program installs the program file prior to returning its path to the application. The installer program continually updates the configuration database if any changes are made to the installed state of the application.
Generally speaking, xe2x80x9cpatchingxe2x80x9d refers to the art of modifying or updating an application from one state to another state. Often, patching is performed if an application is in need of a service release or update to remedy a programming bug or other infirmity. Patching is traditionally performed by executing a patching application which makes slight modifications to the installed application""s files or resources. Patching is traditionally a brute-force mechanism to revise an application from one version to another version without completely reinstalling the application. Unfortunately, there are several problems with traditional patching.
First, the traditional patch modifies the resources of the application, but does not modify the configuration database maintained by the installer program to reflect those modifications. For example, a patch will often add a new program file to the application. However, the patch does not modify the configuration database to make the installer program aware of the existence of the new program file. In addition, the installer program is unable to update its configuration database to reflect the existence of the new file because the patch and new file were not installed by the installer program. The result is that the installer program is unaware that the new program file was added, so any additional functionality provided by the installer program is unavailable for that new program file. For example, the installer program is unable to verify the existence of the new program file if requested by the application.
Another problem with traditional patches is that they may not be able to properly patch an uninstalled or partially-installed application. At installation, the user may choose not to install all of the features of an application, but rather delay the installation of certain features until they are actually used. The installer program may provide an application with the ability to offer the feature as available although the feature is uninstalled (xe2x80x9cadvertisingxe2x80x9d the feature). When the user or application attempts to access that feature for the first time, the installer program then automatically installs the advertised feature. This reduces the amount of storage space consumed by features of an application which are not initially used.
Unfortunately, although the installer program maintains information concerning any advertised features, the traditional patch does not make use of that information. Consequently, when the traditional patch attempts to update an application, any files or resources that are advertised but not installed are not updated. Compounding the problem is the situation where the user selects an advertised feature for the first time after the patch has been applied. The user will likely be unaware that the patch did not update resources related to the advertised feature and therefore will not execute the patch a second time to update the newly-installed resources. Indeed, the user may even be unaware that the advertised feature was just installed. The unhappy result is that the user believes the application to have been fully updated by the patch when that is not the case. Even worse, the application may be left in a mixed state having some resources of one version and other resources of another version. Such a mixed state can be prone to unexpected application errors during use.
Accordingly, there exists a need in the art for an improved method of patching a software application. In addition, a need exists for a method of patching a software application that modifies stored information to properly reflect the installed state of a patched application.
The present invention is directed to a system, method, and computer-readable medium for patching a software application and providing an installer program with notice of the patch""s existence so that the installer program can modify a configuration database to reflect the patch. Simply stated, the present invention makes the installer program patch-aware so that should the user or application make or require any changes to the installed state of the application, the installer program will be able to operate on the system resources with knowledge that the application has either been patched, or that a patch is present for the application (in the case where the application is not yet fully installed). In that manner, all of the additional functionality provided by the installer program to an application is equally applicable to the application in its patched state.
In one embodiment, the installer program is provided with the capability to recognize the launch of a patch file. The patch file may include multiple streams of information, including summary information regarding which application is affected by the patch, transform information regarding changes to an installation file associated with the application, and update information to effect the necessary bit-level changes to existing program files of the application. When the patch file is launched, the installer program uses the summary information to verify that the affected application is installed. Once verified, the installer program initiates an install procedure for the application by reading an installation file associated with the original (unpatched) version, i.e., the installed version of the application. The installation file typically contains information, such as a series of instructions for installing the application, used by the installer program to install the application. For instance, the installation file may define a source for the installation files, registry key values applicable to the application, directory paths for certain files, particular groupings of files to be installed together depending on the user""s installation selections, and the like.
The transform information from the patch file provides the installer program with changes (deletions, additions, or modifications) to be applied to the installation file. The installer program modifies entries in the installation file based on the transform information. Applying the transform information to the installation file results in a modified installation file which defines additional instructions to be performed during a subsequent re-installation of the software application resulting in a patched software application being installed. The modified installation file may reference the patch file as a source for any new program files added by the patch. Any new program files to be added are stored in the update information stream of the patch file.
The modified installation file may include a new portion pertaining to existing program files that are altered by the patch. The new portion of the modified installation file identifies which existing program files must be altered, and identifies which binary bits in the update information stream of the patch file are used to perform the alteration.
Once the modified installation file is achieved, the installer program reinstalls the software application using the modified installation file. Reinstalling the application using the modified installation file results in the installer program storing the patched state of the application in the configuration database. In other words, when the installer program performs its installation, any information related to the patch is stored in the configuration database just like the original installation information for the application. In this way, the installer program maintains full knowledge of any new or modified software application resources related to the patch. This aspect of the invention allows the full functionality of the installer program to attach to the resources added or modified by the patch. In this embodiment of the invention, the modified installation file is not stored for future reference. Rather the configuration database contains an indication that the patch exists so that the original installation file may be modified in accordance with the patch during any subsequent installation or reinstallation operation.
An alternative embodiment of the present invention provides for the patching of network images of software applications. Those of ordinary skill in the art will understand that the network image is essentially a network-resident installable copy of a software application. The process of creating a network image on a server for access by server clients is often called a xe2x80x9cnetwork image installxe2x80x9d or an xe2x80x9cadmin install.xe2x80x9d The network image allows individual users to install the application to their local machines from the server rather than from the original source medium. Patching the network image serves the purpose of allowing the server clients to install a patched version of the application, rather than installing the application and then patching each individual install.
In accordance with this invention, a system administrator patches a network image by launching a patch file from a computer coupled to the server storing the network image of the software application to be patched. Launching the patch file is accomplished in a conventional manner, e.g., inserting a source medium into the computer and instructing the computer to launch the patch file. The system administrator may provide to the patch file, via an API parameter or other means, a path to the network image and an indication that the patch will be applied to the network image. The installer program detects the launch of the patch file and, in response, opens the installation file by accessing the network image location. As above, the installer program creates a modified installation file from the original installation file based on the transform information stored in the patch file. Based on the modified installation file, the installer program creates a new network image of the application by copying unchanged resources of the application from the source medium to the network image location, by copying any new resources from the patch file to the network image location, and by altering any existing resources with patch-bits from the patch file in accordance with instructions contained in the new installation file.
In addition, this alternative embodiment of the invention writes a new installation file, based on the modified installation file, to the network image location. The new installation file reflects the patched version of the application and, accordingly, does not include instructions to reapply the patch during any subsequent installs from the network image. As a result, when users install from the network image, their installed instance of the application is already patched, eliminating the need to install the original software application and, then, apply a patch at their local machine.